import { createRouter, createWebHashHistory } from "vue-router";
const routes =[
  {
    path: "/",
    name: "Home",
    component: () => import("../views/Home.vue"),
    meta: {
      hideLogin: true, // 登录导航是否隐藏
    },
   // 嵌套路由
   children: [
    {
      name: "Like",
      path: "",
      component: () => import("../components/Like.vue"),
      // alias: '',
      // redirect: '',
      // meta: {}
    },
    {
      name: "Latest",
      path: "latest",
      component: () => import("../components/Latest.vue"),
    },
    {
      name: "Reduction",
      path: "reduction",
      component: () => import("../components/Reduction.vue"),
    },
  ],
  },{
    path: "/search",
    name: "Search",
    component: () => import("../views/Search.vue"),
    meta: {
      hideNav: true, // 底部导航是否隐藏
    },
  },{
    path: "/login",
    name: "Login",
    component: () => import("../views/Login.vue"),
    meta: {
      hideNav: true, // 底部导航是否隐藏
    },
  }, {
    path: "/reg",
    name: "Reg",
    component: () => import("../views/Reg.vue"),
    meta: {
      hideNav: true, // 底部导航是否隐藏
    },
  },{
    path: "/play",
    name: "Play",
    component: () => import("../views/Play.vue"),
  },{
    path: "/message",
    name: "Message",
    component: () => import("../views/Message.vue"),
    meta: {
      needLogin: true, // 需要登录才能访问
    },
  },{
    path: "/user",
    name: "User",
    component: () => import("../views/User.vue"),
     meta: {
      needLogin: true, // 需要登录才能访问
    }, 
  },{
    path: "/user_info",
    name: "UserInfo",
     component: () => import("../views/UserInfo.vue"),
   meta: {
      needLogin: true, // 需要登录才能访问
    }, 
  },
  {
    path: "/address",
    name: "Address",
     component: () => import("../views/Address.vue"),
     meta: {
      hideNav: true, // 底部导航是否隐藏
    },
  },{
    path: "/post",
    name: "Post",
    component: () => import("../views/Post.vue"),
    
  },{
    path: "/accountLogin",
    name: "AccountLogin",
    component: () => import("../views/AccountLogin.vue"),
    meta: {
      hideNav: true, // 底部导航是否隐藏
    },
  },{
    path: "/sort",
    name: "Sort",
    component: () => import("../views/Sort.vue"),
    meta: {
      hideNav: true, // 底部导航是否隐藏
    },
  },
  {
    path: "/Fatie",
    name: "Fatie",
    component: () => import("../views/Fatie.vue"),
    meta: {
      needLogin: true, // 需要登录才能访问
    },
  },{
    path: "/idle",
    name: "Idle",
    component: () => import("../views/Idle.vue"),
    meta: {
      needLogin: true, // 需要登录才能访问
      hideNav: true, // 底部导航是否隐藏
    },
  },{
    path: "/detail",
    name: "Detail",
    component: () => import("../views/Detail.vue"),
    children: [
      {
        name: "Comments",
        path: "comments",
        component: () => import("../components/Comments.vue"),
      }
    ]
  }
  ,{
    path: "/mima",
    name: "Mima",
    component: () => import("../views/Mima.vue"),
    
  }
  ,{
    path: "/shoucang",
    name: "Shoucang",
    component: () => import("../views/Shoucang.vue"),
    meta: {
      hideNav: true, // 底部导航是否隐藏
    },
  }
  ,{
    path: "/history",
    name: "History",
    component: () => import("../views/History.vue"),
    meta: {
      hideNav: true, // 底部导航是否隐藏
    },
  },{
    path: "/pdetail",
    name: "Pdetail",
    component: () => import("../views/ProductDetail.vue"),
    meta: {
      hideNav: true, // 底部导航是否隐藏
    },
    
  }
];
export default createRouter({
  history: createWebHashHistory(),
  routes,
});